$(document).ready(function () {		
	$('.dropdown-link')
	.mouseover(function () {
		var target = $(this).data('target');
		clearTimeout(window['time-'+target]);
		if ($('.dropdown-target.open:not(#'+target+')').length) {
			$('.dropdown-target.open:not(#'+target+')').hide();
			if (!$('#'+target).hasClass('open')) $('#'+target).show();
		} else {
			if (!$('#'+target).hasClass('open')) $('#'+target).fadeIn(300);
		}
		$('#'+target).addClass('open');
	})
	.mouseout(function () {
		var target = $(this).data('target');
		window['time-'+target] = setTimeout(
		function () {
			$('#'+target).fadeOut(150);
			$('#'+target).removeClass('open');
		}, 
		150)
	})
	$('.dropdown-target')
	.mouseenter(function () {
		var target = $(this).attr('id');
		clearTimeout(window['time-'+target]);
	})
	.mouseleave(function () {
		var target = $(this).attr('id');
		window['time-'+target] = setTimeout(
		function () {
			$('#'+target).fadeOut(150);
			$('#'+target).removeClass('open');
		}, 
		150)
	})
})